<%@ Page AutoEventWireup="true" CodeBehind="TextEditor.aspx.cs" Inherits="Dascoba.Umb.FileManager.Pages.TextEditor"
    Language="C#" MasterPageFile="../../masterpages/umbracoPage.Master" ValidateRequest="false"
    EnableViewState="True" %>

<%@ Register Assembly="controls" Namespace="umbraco.uicontrols" TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
    <link href="../js/edit_area/edit_area.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../js/edit_area/edit_area_full.js"></script>
    <script type="text/javascript">

        $(window).load(function () {
            resizeTextArea();
        });

        $(window).resize(function () {
            resizeTextArea();
        });

        function resizeTextArea() {
            var contentHeight = $(window).height() - 135;
            $('#<%=this.codeArea.ClientID %>').height(contentHeight);
            $('.tabpagescrollinglayer').css('overflow', 'hidden');
        }
        
    </script>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" ID="bodyContent" runat="server">
    <cc1:TabView ID="tabs_texteditor" runat="server" />
    <cc1:Pane ID="pane_texteditor" runat="server">
        <asp:TextBox ID="codeArea" runat="server" Width="99%" TextMode="MultiLine"></asp:TextBox>
    </cc1:Pane>
</asp:Content>
<asp:Content ContentPlaceHolderID="footer" ID="footerContent" runat="server">
<script type="text/javascript">
    // EditArea initialization
    // toolbar : (combination of: "|", "*", "search", "go_to_line", "undo", "redo", "change_smooth_selection", "select_font" "reset_highlight", "highlight", "word_wrap", "help", "save", "load", "new_document", "syntax_selection") 
    editAreaLoader.init({
        id: "<%=this.codeArea.ClientID %>",
        display: '<%=this.Display %>',
        syntax: '<%=this.ParserName %>',
        is_editable: <%=this.IsEditable %>,
        word_wrap: <%=this.WordWrap %>,
        allow_toggle: <%=this.AllowToggle %>,
        language: '<%=this.Language %>',
        start_highlight: true,
        allow_resize: 'no',
        browsers: 'known',
        toolbar: 'undo, redo, |, search, go_to_line, |, highlight, reset_highlight, |, word_wrap, select_font, |, help'
    });

</script>
</asp:Content>
